package com.rc.saas.mini.service.rc;

import com.rc.saas.mini.mapper.rc.RcMemberLevelSettingMapper;
import com.rc.saas.mini.model.member.MemberAccount;
import com.rc.saas.mini.model.member.MemberInfo;
import com.rc.saas.mini.model.rc.RcMemberLevelSetting;
import com.rc.saas.mini.model.rc.RcMemberLevelSettingExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class RcMemberLevelSettingServiceImpl implements RcMemberLevelSettingService {
    @Autowired
    private RcMemberLevelSettingMapper rcMemberLevelSettingMapper;

    @Override
    public RcMemberLevelSettingMapper getMapper() {
        return rcMemberLevelSettingMapper;
    }

    @Override
    public List<RcMemberLevelSetting> listByDefault() {

        return rcMemberLevelSettingMapper.listByDefault();
    }

    @Override
    public RcMemberLevelSetting selectByMemberAccount(BigDecimal amount) {


        return rcMemberLevelSettingMapper.selectByMemberAccount(amount);
    }

    @Override
    public RcMemberLevelSetting selectByNext(MemberInfo member) {
        //直接查询当前用户余额下最大一级别的数据
        return rcMemberLevelSettingMapper.selectByNext(member.getMemberId());
    }

}
